package com.aioz.security.controller;

import com.aioz.security.aop.annotation.LogInfoAnnotation;
import com.aioz.security.common.ResponseResult;
import com.aioz.security.service.impl.CensusServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 *  数据统计
 * </p>
 *
 * @author Aioz
 * @since 2022-09-28
 */
@RestController
@RequestMapping("/census")
public class CensusController {

    @Resource
    private CensusServiceImpl censusService;

     /*
     * 企业统计求职者简历投递数据
     * 按月份统计
     * */
    @PostMapping("/application/{companyId}")
    @LogInfoAnnotation
    public ResponseResult censusApplyData(@PathVariable Integer companyId){
        return censusService.censusApplyData(companyId);
    }

    /*
     * 企业统计各岗位招聘人数
     * 按岗位统计
     * */
    @PostMapping("/position/{companyId}")
    @LogInfoAnnotation
    public ResponseResult censusPositionData(@PathVariable Integer companyId){
        return censusService.censusPositionData(companyId);
    }

    /*
     * 企业统计面试进度信息
     * 按岗位统计
     * */
    @PostMapping("/interview/{companyId}")
    @LogInfoAnnotation
    public ResponseResult censusInterviewData(@PathVariable Integer companyId){
        return censusService.censusInterviewData(companyId);
    }

    /*
     * 统计所有企业各月份简历投递数量
     * 按企业
     * */
    @GetMapping("/application/all")
    @LogInfoAnnotation
    public ResponseResult censusAppCounts(){
        return censusService.censusApplicationCounts();
    }

    /*
     * 统计所有高热度岗位的star数量
     * 按岗位
     * */
    @GetMapping("/position/all")
    @LogInfoAnnotation
    public ResponseResult censusPositionStars(){
        return censusService.censusPositionStars();
    }
}
